home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Archives
/
Timing
/
TPTCron.lha
/
TPTCron
/
CronTest.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-06
|
1KB
|
39 lines
#include <exec/types.h>
#include "cron.h"
extern long CronEvent();
char *ctime();
main()
{
long retval;
printf("\n\nAdding an event...\n");
retval=CronEvent(ADDEVENT,1L,"dir");
if(retval!=CNOERR) printf("Error adding event\n");
printf("\nListing the events...\n");
retval=CronEvent(LISTEVENTS,0L,NULL);
if(retval==NOEVENTS) printf("No events to list\n");
else if(retval!=CNOERR) printf("Error listing events\n");
printf("\nChecking the time the event will occur...\n");
retval=CronEvent(WHENEVENT,0L,"dir");
if(retval==0L) printf("Event not found\n");
else printf("Dir will occur on: %s",ctime(&retval));
printf("\nDeleting the event...\n");
retval=CronEvent(DELEVENT,0L,"dir");
if(retval>=0) printf("%lu events deleted\n",retval);
else printf("Error deleteing event\n");
printf("\nListing the events again...\n");
retval=CronEvent(LISTEVENTS,0L,NULL);
if(retval==NOEVENTS) printf("No events to list\n");
else if(retval!=CNOERR) printf("Error listing events\n");
printf("\nShutting down TPTCron...\n");
retval=CronEvent(CRONEXIT,0L,NULL);
if(retval!=CNOERR) printf("Error exiting TptCron\n");
}